<template>
  <div class="top-rcmd-wrap">
    <div class="top-rcmd-header">
      <div class="name">为您推荐</div>
      <el-button
        icon="el-icon-refresh"
        size="mini"
        class="button"
        @click="queryRecommendList"
        >换一换</el-button
      >
    </div>
    <div class="top-rcmd-content">
      <VideoCard
        v-for="item in recommendList"
        :key="item.uvid"
        style="width: 19vw;"
        :videoObj="item"
      ></VideoCard>
    </div>
  </div>
</template>

<script>
import VideoItem from "@/components/video/VideoItem.vue";
import VideoCard from "@/components/video/VideoCard.vue";
import { queryHeadRecommendVideoList } from "@/api/home.js";
export default {
  data() {
    return {
      recommendList: [],
    };
  },
  components: { VideoItem, VideoCard },
  created() {
    this.queryRecommendList();
  },
  methods: {
    queryRecommendList() {
      queryHeadRecommendVideoList(1, 8).then((res) => {
        this.recommendList = res.data;
      });
    },
  },
};
</script>
<style scoped>
.top-rcmd-wrap {
  padding: 0 10vw 0 10vw;
  display: block;
  margin-bottom: 40px;
}
.top-rcmd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.top-rcmd-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: space-between;
}
</style>